#ifndef BACKGROUND_H
#define BACKGROUND_H

#include "opencv2/core/core.hpp"

class BackGround
{
public:
    BackGround( const int width , const int height , int channels, int pixelBytes );
    ~BackGround();

    void addImage( const cv::Mat &image );

    const cv::Mat& getBackground();

    void reset();

private:
    // background array.  summation of all the images added to it.
    // should overflow after 16777216 have been added
    uint32_t *bg;
    // size of the image
    int width;
    int height;
    // how many color channels per pixel
    int channels;
    // number of bytes per pixel
    int pixelBytes;

    // the background image
    cv::Mat bgImg;
    // how many images have been added
    int count;


};

#endif // BACKGROUND_H
